import { ApiProperty } from '@nestjs/swagger';
import { IsString, MinLength } from 'class-validator';

export class CreatePlatformDto {
  @ApiProperty({
    example: '京东',
    required: true,
  })
  @IsString()
  readonly name: string;

  @ApiProperty({
    example: 'https://search.jd.com',
    required: true,
  })
  @IsString()
  readonly url: string;
}
export class CreatePlatformWithCookieDto {
  @ApiProperty({
    example: '京东',
    required: true,
  })
  @IsString()
  readonly name: string;

  @ApiProperty({
    example: 'https://search.jd.com',
    required: true,
  })
  @IsString()
  readonly url: string;

  @ApiProperty({
    example: '京东cookie1',
    required: true,
  })
  @IsString()
  readonly cookieName: string;
  @ApiProperty({
    example: 'cookie.json',
    required: true,
  })
  @IsString()
  readonly filename: string;

  @ApiProperty({
    example: '[name:afefa,user:faewf]',
    required: true,
  })
  @IsString()
  @MinLength(1, { message: 'Name must not be empty' })
  readonly content: string;
}
